<?php if (isset($full_page) && $full_page): //判断是否为ajax提交?>
    <?php include(FULL_HTML_VIEWS_PATH . "/common/page_header.php"); ?><?php if (isset($debug_page)): ?>
        <link href="bootstrap_ace/css/bootstrap.min.css" rel="stylesheet">
        <link href="css/main.css" rel="stylesheet">
    <?php endif; ?><?php include(FULL_HTML_VIEWS_PATH . "/common/page_menu.php"); ?>
    <div class="main-content">
    <div class="main-content-inner">
    <div class="page-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <?php include(FULL_HTML_VIEWS_PATH . "/common/page_ur_here.php"); ?>
                </ul>
            </div>
        </div>
    </div>
    <h2 class="sub-header">
        <?php echo $page_title ?>
        <?php if (check_privilege_view(211)): ?>
            <a href="<?php echo site_url("$my_router/info/") ?>" class="btn btn-sm btn-primary pull-right">添加角色管理</a>
        <?php endif; ?>
    </h2>

    <div class="row">
    <div class="col-sm-12">
    <div class="panel panel-default">
        <form id="serch_form" data-action="listSearchForm" class="navbar-form" action="" role="search" method="get">
            <div class="form-group">
                <span class="glyphicon glyphicon-search"></span>
                <input name="keywords" type="text" style="width: 250px;border-width:1px" class="form-control" placeholder="ID/角色名称" value="" id="keywords">
            </div>
            <button type="submit" class="btn btn-primary btn-sm">搜索</button>
            <input type="reset" class="btn btn-warning btn-sm" value="重置"/>
        </form>
    </div>
    <div class="panel panel-default">
    <div id="tableList" class="table-responsive">
<?php endif; ?>
    <form data-action="ajaxForm" action="<?php echo site_url("$my_router/batch") ?>" method="post">
        <table class="table table-striped table-hover text-center">
            <thead>
            <tr>
                <th>
                    <a href="javascript:;" onClick="listTable.sort(this);" ltb-sort="id">id</a>
                </th>
                <th>
                    <a href="javascript:;" onClick="listTable.sort(this);" ltb-sort="role_name">角色名称</a>
                </th>
                <th>
                    <a href="javascript:;" onClick="listTable.sort(this);" ltb-sort="remark">备注</a>
                </th>
                <th>
                    <a href="javascript:;" onClick="listTable.sort(this);" ltb-sort="add_time">添加时间</a>
                </th>
                <th>
                    <a href="javascript:;" onClick="listTable.sort(this);" ltb-sort="active">状态</a>
                </th>
                <th></th>
            </tr>
            </thead>
            <tbody>
            <?php foreach ($lists as $item): ?>
                <tr id="user_<?php echo $item['id'] ?>">
                    <td align="left"><?php echo $item['id']; ?></td>
                    <td align="left"><?php echo $item['role_name']; ?></td>
                    <td align="left"><?php echo $item['remark']; ?></td>
                    <td align="left"><?php echo date('Y-m-d H:i:s', $item['add_time']); ?></td>
                    <td align="left">
                        <?php if (check_privilege_view(212)): ?>
                            <a data-action="toggleStatus" style="color:#090" class="btn btn-sm btn-success <?php echo($item['active'] > 0 ? '' : 'hide') ?>" href="<?php echo site_url("$my_router/ajax/hide/" . $item['id']); ?>" data-toggle="tooltip" data-placement="right" title="点击关闭"><span class="glyphicon glyphicon-ok"></span> 启用</a>
                            <a data-action="toggleStatus" style="color:#F00" class="btn text-primary btn-sm btn-default <?php echo($item['active'] > 0 ? 'hide' : '') ?>" href="<?php echo site_url("$my_router/ajax/show/" . $item['id']); ?>" data-toggle="tooltip" data-placement="right" title="点击启用"><span class="glyphicon glyphicon-ban-circle"></span> 关闭</a>
                        <?php else: ?>
                            <a data-action="toggleStatus" style="color:#090" class="btn btn-sm btn-success <?php echo($item['active'] > 0 ? '' : 'hide') ?>" href="#"></span> 启用</a>
                            <a data-action="toggleStatus" style="color:#F00" class="btn text-primary btn-sm btn-default <?php echo($item['active'] > 0 ? 'hide' : '') ?>" href="#"><span class="glyphicon glyphicon-ban-circle"></span> 关闭</a>
                        <?php endif; ?>
                    </td>
                    <td align="right">
                        <div class="btn-group">
                            <button class="btn btn-primary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> 功能操作<span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" style="min-width:120px">
                                <?php if (check_privilege_view(212)): ?>
                                    <li>
                                        <a href="<?php echo site_url("$my_router/info/" . $item['id']) ?>"><span class="glyphicon glyphicon-edit"></span> 编辑</a>
                                    </li>
                                <?php endif; ?>
                                <?php if (check_privilege_view(213)): ?>
                                    <li>
                                        <a data-action="listRemove" href="javascript:void(0)" data-href="<?php echo site_url("$my_router/ajax/delete/" . $item['id']); ?>" data-target="#tableList" data-confirm="确定要删除吗？"><span class="glyphicon glyphicon-trash"></span> 删除</a>
                                    </li>
                                <?php endif; ?>
                            </ul>
                        </div>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
            <tfoot>
            <?php if ($lists): ?>
            <?php else: ?>
                <tr>
                    <td colspan="99">没有符合条件的数据……</td>
                </tr>
            <?php endif; ?>
            </tfoot>
        </table>
    </form>
<?php include(FULL_HTML_VIEWS_PATH . "/common/page_pager.php"); ?><?php if (isset($full_page) && $full_page): //判断是否为ajax提交?>                            </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    </div>
    <div class="center-block" style="height:30px;"></div>
    </div>
    <?php include(FULL_HTML_VIEWS_PATH . "/common/page_script.html"); ?><?php include(FULL_HTML_VIEWS_PATH . "/common/page_footer.php"); ?><?php endif;  //判断是否为ajax提交?>